/*
 * @Author: wangkg wangkegui@longfor.com
 * @Date: 2024-05-08 17:31:57
 * @Description:
 */
import type { Menu } from '@/router/types';
import type { PropType } from 'vue';

import { MenuModeEnum } from '@/enums/menu-enum';
import { propTypes } from '@/utils/prop-types';

export type Key = string | number;

export const basicProps = {
  items: {
    type: Array as PropType<Menu[]>,
    default: () => []
  },
  // 菜单组件的mode属性
  mode: propTypes.oneOf([MenuModeEnum.VERTICAL, MenuModeEnum.HORIZONTAL]),
  collapse: propTypes.bool,
  onMenuClick: {
    type: Function
  },
  isHorizontal: propTypes.bool
};

export const itemProps = {
  item: {
    type: Object as PropType<Menu>,
    default: () => ({})
  },
  level: propTypes.number,
  showTitle: propTypes.bool,
  isHorizontal: propTypes.bool
};

export const contentProps = {
  item: {
    type: Object as PropType<Menu>,
    default: null
  },
  showTitle: propTypes.bool.def(true),
  level: propTypes.number.def(0),
  isHorizontal: propTypes.bool.def(true)
};
